import 'package:flutter/material.dart';

class ScrollControlView extends StatefulWidget {
  const ScrollControlView({ super.key });

  @override
  _ScrollView createState() => _ScrollView();
}

class _ScrollView extends State<ScrollControlView> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView(
        // 滚动方向 - 垂直方向的时候 子元素的宽度设置无用
        // 横向滚动- 高度设置无用
        scrollDirection: Axis.horizontal,
        children: [
         Container(
            width: 100,
            color: const Color.fromARGB(255, 93, 74, 5),
          ),
         Container(
            width: 100,
            color: const Color.fromARGB(255, 178, 21, 128),
          ),
            Container(
            width: 100,
            color: const Color.fromARGB(255, 14, 211, 76),
          ),
            Container(
            width: 100,
            color: const Color.fromARGB(255, 246, 198, 25),
          ),
            Container(
            width: 100,
            color: const Color.fromARGB(255, 217, 194, 109),
          ),
           Container(
            width: 100,
            color: const Color.fromARGB(255, 93, 74, 5),
          ),
         Container(
            width: 100,
            color: const Color.fromARGB(255, 178, 21, 128),
          ),
            Container(
            width: 100,
            color: const Color.fromARGB(255, 14, 211, 76),
          ),
            Container(
            width: 100,
            color: const Color.fromARGB(255, 246, 198, 25),
          ),
            Container(
            width: 100,
            color: const Color.fromARGB(255, 217, 194, 109),
          ),
        ],
      ),
    );
  }
}


// ListView( children: [] ) // 实现滚动